<template>
    <div class="detail-container" v-loading="loading">
                <el-card class="box-card" style="padding:20px 10px;width:840px;height:1188px;margin:0 auto">
                    <div id="print-div2" style="font-family: 'SimSun'">
                        <div class="title" style="font-size:18px;font-weight: bold;text-align: center;line-height: 22px;padding-top:20px;">工业品买卖合同</div>
                        <div class="paper-top" style="font-size: 14px;margin-top: 10px;margin-bottom: 10px;position: relative;">
                            <div style="width:100%;overflow: hidden">
                                <div style="box-sizing: border-box;overflow: hidden;line-height: 22px;width:60%;float:left;">
                                    <table cellspacing="0" cellpadding="0" border="0" width="100%" style="">
                                        <tr>
                                            <td><div style="width:120px;white-space:nowrap;"><div class="label" style="letter-spacing:2px">出卖人(供方)：</div></div></td>
                                            <td width="620">
                                                <div style="width:100%;">
                                                    <div class="text" style="border-bottom: 1px solid #000;">{{orderInfo.sellerName}}</div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><div style="width:120px;white-space:nowrap;"><div class="label" style="letter-spacing:2px">买受人(需方)：</div></div></td>
                                            <td width="620">
                                                <div style="width:100%;">
                                                    <div class="text" style="border-bottom: 1px solid #000;">{{orderInfo.customerName}}</div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div style="box-sizing: border-box;overflow: hidden;line-height: 22px;width:40%;float:left;">
                                    <div style="box-sizing: border-box;overflow: hidden">
                                        <div style="width:85px;float:left;padding-left:15px;"><div class="label">合同编号：</div></div>
                                        <div  style="width:calc(100% - 100px);float:left;">
                                            <div class="text" style="border-bottom: 1px solid #000;">{{orderInfo.orderSn}}</div>
                                        </div>
                                    </div>

                                    <div style="box-sizing: border-box;overflow: hidden">
                                        <div style="width:85px;float:left;padding-left:15px;"><div class="label">签订地点：</div></div>
                                        <div  style="width:calc(100% - 100px);float:left;">
                                            <div class="text" style="border-bottom: 1px solid #000;">{{orderInfo.orderAddress}}</div>
                                        </div>
                                    </div>

                                    <div style="box-sizing: border-box;overflow: hidden">
                                        <div style="width:85px;float:left;padding-left:15px;"><div class="label">签订日期：</div></div>
                                        <div  style="width:calc(100% - 100px);float:left;">
                                            <div class="text" style="border-bottom: 1px solid #000;">{{orderInfo.createDate}}</div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div style="clear: both"></div>
                        <div class="paper-title" style="font-size: 14px;line-height: 20px;">
                            <span class="title-no">第一条</span>标的、数量、价款及交（提）货时间：
                        </div>
                        <div class="good-table">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border-left:2px solid #000;border-bottom:2px solid #000">
                                <tr>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">商品名称</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">规格型号</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;width:40px">单位</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">数量</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">单价(含税元)</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">不含税金额（元）</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">增值税额</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">含税金额（元）</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:1px solid #000;">税率</th>
                                    <th align="center" style=" font-weight: normal;font-size:12px; border-top:2px solid #000;padding:5px;line-height: 20px;border-right:2px solid #000;">备注</th>
                                </tr>
                                <tr v-for="item in orderInfo.orderGoods">
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con">{{item.goodsName}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" >{{item.goodsSn}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;width:40px"><div class="td-con">{{item.unit}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div  class="td-con" style="white-space:nowrap;">{{item.goodsNum}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" style="white-space:nowrap;">{{item.goodsPrice}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="white-space:nowrap;"  class="td-con">{{item.goodsAmountNotTax }}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="white-space:nowrap;"  class="td-con">
                                      {{ item.taxRateAmount}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="white-space:nowrap;"  class="td-con">{{item.goodsAmount}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="white-space:nowrap;"  class="td-con">
                                      {{ item.taxRate }}</div></td>
                                    <td align="center"  style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right: 2px solid #000"><div class="td-con" style="max-width:150px">{{item.remark}}</div></td>
                                </tr>
                                <!--仅推广订单显示-->
                                <tr v-if="orderInfo.isMoresuOnlineOrder == 1">
                                    <td colspan="2"  style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="letter-spacing: 11px;padding-left:15px">运费</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;width:60px"><div class="td-con"></div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div  class="td-con" style="white-space:nowrap;"></div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" style="white-space:nowrap;"></div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" style="white-space:nowrap;"></div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="white-space:nowrap;"  class="td-con">{{orderInfo.orderShippingFee}}</div></td>
                                    <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" style="white-space:nowrap;"></div></td>
                                  <td align="center" style="font-weight: normal;border-right: 0px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div class="td-con" style="white-space:nowrap;"></div></td>
                                    <td align="center"  style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right: 2px solid #000"><div class="td-con" style="max-width:150px"></div></td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="font-weight: normal;border-right: 1px solid #000;border-top: 1px solid #000;padding: 5px;line-height: 20px;"><div style="letter-spacing: 11px;padding-left:15px">合计</div></td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0"></td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0">{{orderInfo.ordGoodsNum}}</td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0"></td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0">{{orderInfo.goodsAmountNotTax }}</td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0"></td>
                                    <td align="center" style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right:0">{{orderInfo.goodsAmount}}</td>
                                    <td align="center"  style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right: 0"></td>
                                    <td align="center"  style="font-weight: normal;border-top: 1px solid #000;padding: 5px;line-height: 20px;border-right: 2px solid #000"></td>
                                </tr>
                            </table>
                        </div>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" style="padding-right: 10px;"><div style="white-space:nowrap;">第二条</div></td>
                                <td><div style="white-space:nowrap;">货物总金额：</div></td>
                                <td width="620" >
                                    <div class="tianXie" style="font-size: 14px;text-decoration: underline;">{{orderInfo.goodsAmountZH | fifterNull}}(供货方按规定开具增值税专用发票) 。
                                    <span v-if="form=='caiwu'" style="font-weight: bold;font-size:16px">
                                    {{orderInfo.isInvoiceNeedDetail == 1 ? '' : orderInfo.isInvoiceNeedDetail == 0 ? '(开票不开明细)' : ''}}
                                </span>
                                </div>
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" style="padding-right: 10px;"><div style="white-space:nowrap;">第三条</div></td>
                                <td><div style="white-space:nowrap;">质量标准、对质量负责的条件及期限：</div></td>
                                <td width="620"><div class="tianXie" style="font-size: 14px;text-decoration: underline;">按原厂出厂标准及原厂厂家售后服务标准执行。</div></td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" style="padding-right: 10px;"><div style="white-space:nowrap;">第四条</div></td>
                                <td><div style="white-space:nowrap;">包装标准、包装物的供应与回收：</div></td>
                                <td width="620"><div class="tianXie" style="font-size: 14px;text-decoration: underline;">原厂包装，包装物不回收。</div></td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" style="padding-right: 10px;"><div style="white-space:nowrap;">第五条</div></td>
                                <td><div style="white-space:nowrap;">标的物自</div></td>
                                <td width="640">
                                    <span class="tianXie" style="font-size: 14px;text-decoration: underline;">买受人收到</span>
                                    时起转移，但买受人未支付价款义务的，标的物仍属于出卖人。
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第六条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">交（提）货方式、地点：</div></td>
                                <td width="620" valign="top">
                                    <div class="tianXie" style="font-size: 14px;text-decoration: underline;">{{orderInfo.deliveryType | fifterNull}}</div>
                                    <div class="tianXie" v-if="orderInfo.addressInfo != '' && !checked" style="font-size: 14px;text-decoration: underline;">{{orderInfo.addressInfo}}</div>
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第七条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">运输方式及到达站（港）和费用负担：</div></td>
                                <td width="620" valign="top">
                                    <div class="tianXie" style="font-size: 14px;text-decoration: underline;">{{orderInfo.sendType | fifterNull}}</div>
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第八条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">检验标准及期限：</div></td>
                                <td width="620" valign="top">
                                    <div class="tianXie" style="font-size: 14px;text-decoration: underline;">产品外观质量及数量交付时当场验收，产品内在质量买受人有异议，应于7日内书面提出，超出检验期未提异议的,视为对质量认可，标准按原厂执行。如实际交（收）货数量与合同有异，以实际数量为准。</div>
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第九条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">结算方式、时间及地点：</div></td>
                                <td width="620" valign="top">
                                    <div class="tianXie" style="font-size: 14px;text-decoration: underline;">{{orderInfo.settleType | fifterNull}}</div>
                                </td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第十条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">违约责任：</div></td>
                                <td width="620" valign="top">
                                </td>
                            </tr>
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"></td>
                                <td valign="top" colspan="2">供方如承担赔偿责任的，仅限于需方的直接损失，并且不超过合同总货款的15%。需方如延期付款的，供方有权要求需方每日承担总货款0.08%的违约金，直至货款付清为止。逾期超过三日，供方有权解除合同，合同解除后，需方还应按照合同总金额15%承担违约责任(不包含解除前的违约金)。因需方原因（如未按约定付款、收货地址变更等）造成的货物二次转运，产生的费用由需方承担，且供方有权将货物运至供方仓库，运费从需方定金中扣除。</td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;">第十一条</div></td>
                                <td valign="top"><div>合同争议解决方式：本合同在履行过程中发生的争议，由双方当事人协商解决；协调或调解不成的，依法向合同签订地人民法院起诉。</div></td>
                            </tr>
                        </table>
                        <table class="paper-title" border="0" width="100%" style="font-size: 14px;line-height: 20px;">
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"><div style="white-space:nowrap;" >第十二条</div></td>
                                <td valign="top"><div style="white-space:nowrap;">其他约定事项：</div></td>
                                <td width="620" valign="top">
                                </td>
                            </tr>
                            <tr>
                                <td class="title-no" valign="top" style="padding-right: 10px;"></td>
                                <td valign="top" colspan="2">
                                    <div>1、非供方原因或遭遇不可抗力如自然灾害、战争等，其他非正常因素如供方上游延迟发货、生产工厂停车检修或上游船期延误等而造成供方无法按时送货或需方提货的，供方不承担相应的违约责任。</div>
                                    <div>2、收到合同后当日内盖章回传有效，合同传真或电子档件同样有效。</div>
<!--                                    <div>3、本合同有效期为自合同签定之日起1年。</div>-->
                                    <div>3、如在本合同签订日前双方还有未执行完的合同，发货按合同签订时间先后顺序执行。</div>
                                    <div style="word-break:break-all" v-if="orderInfo.contractOtherRemark && orderInfo.contractOtherRemark != ''">4、{{orderInfo.contractOtherRemark}} </div>
                                </td>
                            </tr>
                        </table>
                        <div class="paper-bottom" style="position: relative;margin-top:20px;line-height: 20px;font-size:14px;">
                            <img :src="orderInfo.imageUrl" id="imageGZ" style="position: absolute;left: 95px; width: 156px;top: 0px;" v-if="orderInfo.orderState==40 || (orderInfo.orderState>=20 && orderInfo.isMoresuOnlineOrder==1 && orderInfo.isMoresuNeedCheck==0)"/>
                            <el-row :gutter="20" style="box-sizing: border-box">
                                <el-col :span="12" style="text-align: center;width:50%;float:left;">出卖人</el-col>
                                <el-col :span="12" style="text-align: center;width:50%;float:left;">买受人</el-col>
                            </el-row>
                            <el-row :gutter="20" style="margin-top:10px;box-sizing: border-box">
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="7" style="width:29.16667%;float:left;"><div class="label" style="letter-spacing:2px">出卖方(章)：</div></el-col>
                                        <el-col :span="17" style="width:70.83333%;float:left;">
                                            <div class="text">{{orderInfo.sellerName}}</div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="7" style="width:29.16667%;float:left;"><div class="label">买受人（章）：</div></el-col>
                                        <el-col :span="17" style="width:70.83333%;float:left;">
                                            <div class="text">{{orderInfo.customerName}}</div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20" style="box-sizing: border-box">
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="7" style="width:29.16667%;float:left;"><div class="label"><span style="padding-right:54px">电</span>话：</div></el-col>
                                        <el-col :span="17" style="width:70.83333%;float:left;">
                                            <div class="text">{{orderInfo.sellerPhone}}</div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="8" style="width:33.33333%;float:left;"><div class="label"><span style="padding-right:56px">电</span>话：</div></el-col>
                                        <el-col :span="16" style="width:66.66667%;float:left;">
                                            <div class="text">{{orderInfo.contactUser}}</div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20" style="box-sizing: border-box">
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="7" style="width:29.16667%;float:left;"><div class="label"><span style="padding-right:54px">传</span>真：</div></el-col>
                                        <el-col :span="17" style="width:70.83333%;float:left;">
                                            <div class="text">{{orderInfo.sellerFax}}</div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="12" style="width:50%;float:left;">
                                    <el-row style="box-sizing: border-box">
                                        <el-col :span="8" style="width:33.33333%;float:left;"><div class="label"><span style="padding-right:56px">传</span>真：</div></el-col>
                                        <el-col :span="16" style="width:66.66667%;float:left;">
                                            <div class="text"></div>
                                        </el-col>
                                    </el-row>
                                </el-col>
                            </el-row>
<!--                            <div style="text-align: right;margin-top:20px">常州市工商管理局监制</div>-->
                        </div>
                    </div>
                </el-card>
                <div style="margin-top:40px;text-align: center" v-if="isPums==0">
                    <div v-if="hideAddress">
                      <el-checkbox v-model="checked" style="margin-right:10px" @change="changeCheck">不显示地址</el-checkbox>
                    </div>
                    <div style="padding:12px;line-height:22px;font-size:12px"
                         v-show="orderInfo.originalContractUrl != ''">
                        如需刷新PDF,请点击
                        <el-button type="text" @click="generatePdf" :loading="btnLoading"  icon="el-icon-refresh-left">重新生成</el-button>
                        <span style="color:red;padding-left:10px">注：重新生成后原先的PDF将会失效</span>
                    </div>
                    <el-button type="primary" style="width:150px;" @click="seePDF" v-if="orderInfo.originalContractUrl != ''">查看PDF</el-button>
                    <el-button type="primary" style="width:150px;" @click="generatePdf" :loading="btnLoading" v-else>生成PDF</el-button>
                    <el-button  style="width:150px;" @click="goBlack">返回</el-button>
                    <el-button style="width:150px;" @click="printdiv" v-if="printModification">打印修改</el-button>
                </div>



    </div>
</template>
<script>
    import { mapGetters } from 'vuex'
    import store from '@/store'
    import {rcPrintOrder,downPdf,changeHideAddress} from '@/api/partner'
    import "@/utils/jQuery.print"
    export default {
        name: "rcCustomerDetail",
        data(){
            return{
                roles:store.getters.roles ? store.getters.roles : [],
                loading:false,
                orderId:this.$route.query.id,
                type:this.$route.query.type,
                form:this.$route.query.form,
                orderInfo:{},
                isPums:this.$route.query.isPums ? this.$route.query.isPums : 0,
                btnLoading:false,
                checked:false
            }
        },
        computed: {
            ...mapGetters([
                'name',
                'mobile',
                'userId'
            ]),
          hideAddress(){
            if(this.roles.indexOf("hideAddress") != -1){
              return true
            }else{
              return false
            }
          },
          printModification(){
            if(this.roles.indexOf("printModification") != -1){
              return true
            }else{
              return false
            }
          },
        },
        created() {
            this.getPageInfo();
        },
        filters: {
            fifterNull(val){
                if(val == ''){
                    return '无'
                }else{
                    return  val
                }
            }
        },
        methods:{
            changeCheck(){
                changeHideAddress({orderId:this.orderId,isHideAddress:this.checked ? 1 :0}).then((res)=>{
                    this.getPageInfo();
                })
            },
            goBlack(){
                this.$router.go(-1)
            },
            //打印
            printdiv(){
               //  this.btnLoading = true;
               // downPdf({orderId:this.orderId}).then((res)=>{
               //      this.btnLoading = false;
               //     this.$message({
               //         type: 'success',
               //         message: '操作成功!'
               //     });
               //      window.open(res)
               //
               // }).catch(()=>{
               //     this.btnLoading = false;
               // })
                $("#print-div2").print({
                    globalStyles:true,//是否包含父文档的样式，默认为true
                    mediaPrint:true,//是否包含media='print'的链接标签。会被globalStyles选项覆盖，默认为false
                    stylesheet:null,//外部样式表的URL地址，默认为null
                    noPrintSelector:".no-print",//不想打印的元素的jQuery选择器，默认为".no-print"
                    iframe:true,//是否使用一个iframe来替代打印表单的弹出窗口，true为在本页面进行打印，false就是说新开一个页面打印，默认为true
                    append:null,//将内容添加到打印内容的后面
                    prepend:null,//将内容添加到打印内容的前面，可以用来作为要打印内容
                    deferred: $.Deferred()//回调函数
                });
            },
            seePDF(){
                window.open(this.orderInfo.originalContractUrl);
            },
            generatePdf(){
                this.btnLoading = true;
                let unFinishedSend = this.type == 3 ? 1 : 0
                downPdf({orderId:this.orderId,type:this.type,unFinishedSend:unFinishedSend}).then((res)=>{
                    this.btnLoading = false;
                    this.getPageInfo();
                    window.open(res);
                }).catch(()=>{
                    this.btnLoading = false;
                })
            },

            //获取合同详情
            getPageInfo(){
                this.loading = true;
                let unFinishedSend = this.type == 3 ? 1 : 0
                rcPrintOrder({orderId:this.orderId,type:this.type,unFinishedSend:unFinishedSend}).then(res=>{
                    this.orderInfo = res;
                    this.checked = res.isHideAddress==1
                    this.loading = false;
                    // this.qrcode = new QRCode("qrcode", {
                    //     text: 'https://pic.moresu.com/%E5%90%88%E5%90%8C%E5%8F%B7XSDD20210100552_195030.pdf',
                    //     width: 120,
                    //     height: 120,
                    //     colorDark : "#000000",
                    //     colorLight : "#ffffff",
                    // });
                });
            },


        }
    }
</script>

<style lang="scss">
    .detail-container {
        width: 90%;
        padding: 20px 20px 20px 20px;
        margin: 20px auto;
    }
    #print-div2{
        font-size:12px;
        font-family: "SimSun";
        .title{
            font-size:18px;
            font-weight: bold;
            text-align: center;
            line-height: 22px;
            padding-top:20px;
        }
        .paper-top{
            font-size:14px;
            margin-top:10px;
            .label{
            }
            .text{
                border-bottom:1px solid #000;
            }
            margin-bottom:10px;
        }
        .paper-title{
            font-size:14px;
            line-height: 20px;
            .title-no{
                padding-right:10px;
            }
            .tianXie{
                font-size:14px;
                text-decoration: underline;
            }
        }
        .good-table{
            table{
                border-left:2px solid #000;
                border-bottom:2px solid #000;
                th{
                    font-weight: normal;
                    font-size:14px;
                    border-top:2px solid #000;
                    padding:5px 10px;
                    line-height: 20px;
                    border-right:1px solid #000;
                }
                td{
                    font-weight: normal;
                    border-right:1px solid #000;
                    border-top:1px solid #000;
                    padding:5px 10px;
                    line-height: 20px;
                }
                .td-con{
                    word-break:break-all;
                    font-size:12px;
                }
            }
        }
        .paper-bottom{
            margin-top:20px;
            line-height: 20px;
            font-size:14px;
        }
    }
</style>
